package Pages.System;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ResourceBundle;

/**
 * description:
 * author: 柳胜酉
 * 2022/7/8
 */
public class CharacterPage extends JFrame {
    private JPanel dialogPane;
    private JPanel contentPanel;
    private JPanel panel3;
    private JPanel panel4;
    private JLabel label1;
    private JLabel label3;
    private JPanel panel5;
    private JLabel label4;
    private JLabel label5;
    private JPanel panel6;
    private JPanel panel9;
    private JButton button4;
    private JButton button5;
    private JPanel panel10;
    private JPanel panel11;
    private JLabel label6;
    public CharacterPage() {
        initComponents();
    }

    private void initComponents() {
        ResourceBundle bundle = ResourceBundle.getBundle("P0704");
        dialogPane = new JPanel();
        contentPanel = new JPanel();
        panel3 = new JPanel();
        panel4 = new JPanel();
        label1 = new JLabel();
        label3 = new JLabel();
        panel5 = new JPanel();
        label4 = new JLabel();
        label5 = new JLabel();
        panel6 = new JPanel();
        panel9 = new JPanel();
        button4 = new JButton();
        button5 = new JButton();
        panel10 = new JPanel();
        panel11 = new JPanel();
        label6 = new JLabel();

        //======== this ========
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);
        setTitle("\u767b\u5f55\u9009\u62e9");
        setMaximizedBounds(new Rectangle(0, 0, 360, 460));
        setMinimumSize(new Dimension(360, 460));
        var contentPane = getContentPane();
        contentPane.setLayout(new BorderLayout());

        //======== dialogPane ========
        {
            dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12));
            dialogPane.setBackground(SystemColor.inactiveCaption);
            dialogPane.setMaximumSize(null);
            dialogPane.setMinimumSize(null);
            dialogPane.setLayout(new BorderLayout());

            //======== contentPanel ========
            {
                contentPanel.setBackground(SystemColor.inactiveCaption);
                contentPanel.setLayout(new CardLayout());

                //======== panel3 ========
                {
                    panel3.setBackground(SystemColor.inactiveCaption);
                    panel3.setLayout(new GridLayout(3, 1));

                    //======== panel4 ========
                    {
                        panel4.setBackground(SystemColor.activeCaption);
                        panel4.setLayout(new GridLayout(2, 1));

                        //---- label1 ----
                        label1.setText(bundle.getString("CharacterPage.label1.text"));
                        label1.setHorizontalAlignment(SwingConstants.CENTER);
                        label1.setFont(label1.getFont().deriveFont(label1.getFont().getSize() + 20f));
                        label1.setForeground(Color.white);
                        panel4.add(label1);

                        //---- label3 ----
                        label3.setText(bundle.getString("CharacterPage.label3.text"));
                        label3.setHorizontalAlignment(SwingConstants.CENTER);
                        label3.setFont(label3.getFont().deriveFont(label3.getFont().getSize() + 20f));
                        label3.setForeground(Color.white);
                        label3.setIcon(new ImageIcon(getClass().getResource("/image/\u767b\u5f55_login10.png")));
                        panel4.add(label3);
                    }
                    panel3.add(panel4);

                    //======== panel5 ========
                    {
                        panel5.setBackground(SystemColor.inactiveCaption);
                        panel5.setLayout(new GridLayout(1, 2));

                        //---- label4 ----
                        label4.setIcon(new ImageIcon(getClass().getResource("/image/\u8001\u5e081.png")));
                        label4.setHorizontalAlignment(SwingConstants.CENTER);
                        panel5.add(label4);

                        //---- label5 ----
                        label5.setHorizontalAlignment(SwingConstants.CENTER);
                        label5.setIcon(new ImageIcon(getClass().getResource("/image/\u5b66\u751f1.png")));
                        panel5.add(label5);
                    }
                    panel3.add(panel5);

                    //======== panel6 ========
                    {
                        panel6.setBackground(SystemColor.inactiveCaption);
                        panel6.setLayout(new GridLayout(3, 1));

                        //======== panel9 ========
                        {
                            panel9.setLayout(new GridLayout(1, 2));

                            //---- button4 ----
                            button4.setText(bundle.getString("CharacterPage.button4.text"));
                            button4.setFont(button4.getFont().deriveFont(button4.getFont().getSize() + 10f));
                            panel9.add(button4);

                            //---- button5 ----
                            button5.setText(bundle.getString("CharacterPage.button5.text"));
                            button5.setFont(button5.getFont().deriveFont(button5.getFont().getSize() + 10f));
                            panel9.add(button5);
                        }
                        panel6.add(panel9);

                        //======== panel10 ========
                        {
                            panel10.setBackground(SystemColor.inactiveCaption);
                            panel10.setLayout(new GridLayout(1, 1));
                        }
                        panel6.add(panel10);

                        //======== panel11 ========
                        {
                            panel11.setBackground(SystemColor.inactiveCaption);
                            panel11.setLayout(new GridLayout(1, 1));

                            //---- label6 ----
                            label6.setText(bundle.getString("CharacterPage.label6.text"));
                            label6.setForeground(Color.white);
                            panel11.add(label6);
                        }
                        panel6.add(panel11);
                    }
                    panel3.add(panel6);
                }
                contentPanel.add(panel3, "card1");
            }
            dialogPane.add(contentPanel, BorderLayout.CENTER);
        }
        contentPane.add(dialogPane, BorderLayout.CENTER);
        setSize(380, 460);
        setLocationRelativeTo(null);

        button4.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new TRegisterPage().setVisible(true);
                setVisible(false);
            }
        });

        button5.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new SRegisterPage().setVisible(true);
                setVisible(false);
            }
        });
    }

    public static void main(String[] args) {
        new CharacterPage().setVisible(true);
    }
}

